home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************\
- * *
- * SIMPLESELECT and SIMPLEDESELECT commands for Directory Opus 5 *
- * *
- * Written by Timo Kaikumaa (timok@cc.tut.fi) *
- * *
- * ARexx script for Directory Opus 5.5 giving you two new *
- * select commands. To make them work, place this script into *
- * "dopus5:modules" directory. *
- * *
- * This script was written because the original DOpus select *
- * command is rather clumsy to use, especially when deselecting *
- * files. Both "SimpleSelect" and "SimpleDeselect" open up a *
- * requester asking a filename only pattern to (de)select files. *
- * *
- * The commands will operate on multiple source directories in *
- * case they were executed outside any lister context. *
- * *
- * Bugs: the pattern used is not memorized like in the original *
- * select command. *
- * *
- * Hint: try these commands in lister toolbar - use left mouse *
- * button for SimpleSelect and right button for SimpleDeselect. *
- * *
- \*****************************************************************/
-
- /* $VER: simplesel.dopus5 1.2 (25.1.97)
- */
-
- parse arg portname function source dest arguments
- address value portname
- options results
-
-
- /* Initialization */
-
- if function = 'init' then do
- dopus command "SimpleSelect" program "simplesel" desc "'Simple-select files'" source
- dopus command "SimpleDeselect" program "simplesel" desc "'Simple-deselect files'" source
- exit
- end
-
-
- /* SimpleSelect */
-
- if function = 'SimpleSelect' then do
- if source ~= 0 then do
- lister query source path
- if RESULT = "" then exit
- lister getstring source '"Enter select pattern to match filenames." 40 "*" _OK|_Cancel'
- if DOPUSRC = 0 then exit
- command "source" source select include name RESULT
- exit
- end
- else do
- lister query "source" stem multi
- if multi.count = 0 then exit
- dopus getstring '"Enter select pattern to match filenames." 40 "*" _OK|_Cancel'
- if DOPUSRC = 0 then exit
- command select include name RESULT
- exit
- end
- end
-
-
- /* SimpleDeselect */
-
- if function = 'SimpleDeselect' then do
- if source ~= 0 then do
- lister query source path
- if RESULT = "" then exit
- lister getstring source '"Enter deselect pattern to match filenames." 40 "" _OK|_Cancel'
- if DOPUSRC = 0 then exit
- command "source" source select exclude name RESULT
- exit
- end
- else do
- lister query "source" stem multi
- if multi.count = 0 then exit
- dopus getstring '"Enter deselect pattern to match filenames." 40 "*" _OK|_Cancel'
- if DOPUSRC = 0 then exit
- command select exclude name RESULT
- exit
- end
- end
-